﻿using System;
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using SqlSugar;

namespace XinLife.Model
{
    public class BaseModel
    {
        /// <summary>
        /// 主键ID
        /// </summary>
        [Key]
        [SugarColumn(IsPrimaryKey = true)]
        public string cId { get; set; }
        /// <summary>
        /// 创建人
        /// </summary>
        public string cCreatedBy { get; set; }
        /// <summary>
        /// 创建时间
        /// </summary>
        public DateTime? cCreatedDate { get; set; }
        /// <summary>
        /// 修改人
        /// </summary>
        public string cUpdatedBy { get; set; }
        /// <summary>
        /// 修改时间
        /// </summary>
        public DateTime? cUpdatedDate { get; set; }


        public virtual void Create(string userId)
        {
            cCreatedBy = userId;
            cCreatedDate = DateTime.Now;

            cUpdatedBy = userId;
            cUpdatedDate = DateTime.Now;
        }
        public virtual void Update(string userId)
        {
            this.cUpdatedBy = userId;
            this.cUpdatedDate = DateTime.Now;
        }

    }
}
